<?php
/**
 * 系统管理员列表
 * 处理视图所需的变量
 *
 */



// 保存数据框架名
$save_frame = $_SESSION[$G_admin_session_key]['save_frame'];
$back_url   = get_current_url();
// 将当前URL保存在Cookie中，避免复杂的URL字符串
cookie('back_url', strcode($back_url));
$url_cur    = get_current_url(array('orderby', 'desc'));
// 排序
$orderlist  = array('id', 'rolename');
$arr_orderby= parse_orderby($orderlist, 'id', $url_cur);




require($abs_admin_cppath . '/header.php');
?>
<div class="datacontainer1">
<form action="<?php echo $mod_url['r.li']; ?>" name="search" method="get">
<div class="new_line" style="text-align:right">
	<div class="spW10 fl"></div>
	<a href="<?php echo $mod_url['r.add']; ?>" class="btn fl">新增系统角色</a>
	<input type="hidden" name="mod" value="<?php echo $mod; ?>">
	<input type="hidden" name="action" value="<?php echo $action; ?>">
</div>
</form>

<TABLE BORDER="0" CELLPADDING="4" CELLSPACING="1" width="100%" class="list_table">
<form action="<?php echo $mod_url['r.del']; ?>" name="items_form" target="<?php echo $save_frame ?>" method="post" onsubmit="return submit_select_items(this.name, 'item_id[]');">
<THEAD>
	<TR class="list_head">
		<TH scope=col width="30" class="textC"><a href="<?php echo $arr_orderby['uid']; ?>">#</a></TH>
		<TH scope=col class="textc"><a href="<?php echo $arr_orderby['rolename']; ?>">角色名称</a></TH>
		<TH scope=col width="150">操作</TH></TR></THEAD>
<TBODY>
<?php
$tr_class_name  = '';
if(is_array($record['record']) && sizeof($record['record']) > 0) {
    foreach($record['record'] as $k=>$v) {
        $tr_class_name  = $tr_class_name != 'tr0' ? 'tr0' : 'tr1';
?>
	<TR onmouseover="return chgBg(this, 1);" onmouseout="return chgBg(this, 0);" class="<?php echo $tr_class_name?>">
		<TD width="30" class="textC"><input type="checkbox" value="<?php echo $v['id']; ?>" name="item_id[]"></TD>
		<TD><?php echo $v['rolename']; ?></TD>
		<TD width="150" class="textC">
		[<a href="<?php echo $mod_url['r.modify']; ?>&id=<?php echo $v['id']; ?>">修改</a>] | 
		[<a href="<?php echo $mod_url['r.del']; ?>&item_id=<?php echo $v['id']; ?>" target="<?php echo $save_frame?>" onclick="return del_this();">删除</a>]
		</TD></TR>
<?php
    }
} else {
    // 没有记录
}
?>
</TBODY>
</TABLE>
<?php
$page_info  = "共 {$record['record_total']} 条记录 每页 {$record['page_size']} 条 共 {$record['page_total']} 页 ";
$page_list  = get_page_nav($record['page_total']);
?>
<div class="page_nav">
	<div class="page_list_pre">
		&nbsp;&nbsp;<a href="javascript:chkbox_sel_all('items_form', 'item_id[]');"><B>全选</B></a> <a href="javascript:chkbox_sel_reverse('items_form', 'item_id[]');"><B>反选</B></a>
	</div>
	<div class="page_list">
		<?php echo $page_list?>
	</div>
	<div class="page_info">
		<?php echo $page_info ?>
	</div>
	<div id="clear_both"></div>
</div>

<div class="new_line borderTop">
<div class="spW10 fl"></div>
<input type="submit" name="del" value="删除" class="btn fl">
<input type="hidden" name="deltype" value="all">
</div>
</form>
<div style="font-size: 10px;margin-bottom: 10px;border:1px solid silver;padding:5px;line-height: 15px;">说明：<br/>
--角色-- 给予系统用户栏目权限，即系统用户登录后可操作哪些栏目<br />
</div>
</div>
<?php
require($abs_admin_cppath . '/footer.php');
?>